
$(".logins").click(function(e){
        var username=$("#username").val();
        var password=$("#password").val();
        $.ajax({
            type:'POST',
            url:'http://localhost:8080/front/login',
            data:{"username":username,"password":password},
            success:function (data) {
                var Objdata=JSON.parse(data);
                $.cookie("name",Objdata.name);
                $.cookie("image",Objdata.image);
                console.log($.cookie("name"));
                $(".login-p").text($.cookie("name"));
                $('#myModal').modal('toggle');
                $(".email").css("display","none");
                window.location.reload()
            },error: function(XMLHttpRequest, textStatus, errorThrown) {
                alert(2+" "+XMLHttpRequest + " " + textStatus + " " + errorThrown)
            }
        });
    }
)
$(".registers").click(
    function (e) {
        var name=$("#name").val();
        var phone=$("#phone").val();
        var password=$("#passwords").val();
        $.ajax({
            url:'http://localhost:8080/front/register',
            type:'POST',
            data:{"name":name,"phone":phone,"password":password},
            success:function (data) {
                $('#myModal1').modal('toggle');
                if(data=="1"){
                    alert("成功")
                }else{
                    alert("失败")
                }

            }
        })
    }
)

var vm=new Vue({
    el:"#bs-example-navbar-collapse-1",
    data:{
        name:$.cookie("name"),
        image:$.cookie("image")
    }

})

new Vue({
    el:".content",
    data(){
        return{
            basiclist:[]
        }
    },
    mounted: function () {
        this.cords();
    },
    methods:{
        cords:function () {
            var bb=$(".bb").text();
            var params = new URLSearchParams();
            params.append('id',bb);
            axios.post('http://localhost:8080/front/basiclists',params).then(res=>res.data).then(data=>{
                this.basiclist=data;
            })
        }
    }
})
$(".sss").click(function () {
    var bb=$(".bb").text();
    alert(bb);
})